package com.okaysoft.ofb

/**
 * 模板详细
 */
class FormworkDetail {

    Category category
    String composition

    static hasMany = [formworkCompositions:FormworkComposition]

    static belongsTo = [formwork:Formwork]

    static constraints = {
    }

    enum Category {
        A(0, 'A面'),
        B(1, 'B面')
        String label
        int id

        Category(int id, String label) {
            this.id = id
            this.label = label
        }
    }

    //布局
    enum Composition {
        C_1_1(0, 'c_1_1'),
        C_2_1(1, 'c_2_1'),
        C_2_2(2, 'c_2_2'),
        C_3_1(3, 'c_3_1'),
        C_3_2(4, 'c_3_2'),
        C_3_3(5, 'c_3_3'),
        C_3_4(6, 'c_3_4'),
        C_3_5(7, 'c_3_5'),
        C_3_6(8, 'c_3_6')

        String label
        int id

        Composition(int id, String label) {
            this.id = id
            this.label = label
        }
    }

    public static Map compositionMap() {
         [1:['c_1_1'],2:['c_2_1','c_2_2'],3:['c_3_1','c_3_2','c_3_3','c_3_4','c_3_5','c_3_6']]
    }
}
